import { Component } from '@angular/core';
import { ApiService } from 'src/app/core/api';
import { NzMessageService } from 'ng-zorro-antd';
import { Router } from '@angular/router';
import { MessageService } from 'src/app/core/service/message.service';

@Component({
    templateUrl: './notice.html',
    styleUrls: ['./notice.scss']
})
export class NoticeListComponent {
    page = { pageNo: 1, pages: 1 };
    isSmall=true;
    // list=[]
    list = [{
        v:13,
        "id": 1,
        "title": "安防工程",
        "content": "内容",
        'name':'公安三所',
        "createTime": "2019-12-05 14:53:05",
        "editTime": null,
        'img':'../../../../assets/img/home-page/cmr01.jpg'
    },{
        v:15,
        "id": 1,
        "title": "安防线缆",
        "content": "内容",
        'name':'公安三所',
        "createTime": "2019-12-05 14:53:05",
        "editTime": null,
        'img':'../../../../assets/img/home-page/cmr01.jpg'
    },{
        v:61,
        "id": 1,
        "title": "安全防范高清视频监控系统技术要求",
        "content": "内容",
        'name':'公安三所',
        "createTime": "2019-12-05 14:53:05",
        "editTime": null,
        'img':'../../../../assets/img/home-page/cmr01.jpg'
    },{
        v:37,
        "id": 1,
        "title": "安全防范工程",
        "content": "内容",
        'name':'公安三所',
        "createTime": "2019-12-05 14:53:05",
        "editTime": null,
        'img':'../../../../assets/img/home-page/cmr01.jpg'
    },{
        v:32,
        "id": 1,
        "title": "安全防范系统",
        "content": "内容",
        'name':'公安三所',
        "createTime": "2019-12-05 14:53:05",
        "editTime": null,
        'img':'../../../../assets/img/home-page/cmr01.jpg'
    },{
        v:24,
        "id": 1,
        "title": "报警运营",
        "content": "内容",
        'name':'公安三所',
        "createTime": "2019-12-05 14:53:05",
        "editTime": null,
        'img':'../../../../assets/img/home-page/cmr01.jpg'
    },{
        v:11,
        "id": 1,
        "title": "博物馆和文物保护单位",
        "content": "内容",
        'name':'公安三所',
        "createTime": "2019-12-05 14:53:05",
        "editTime": null,
        'img':'../../../../assets/img/home-page/cmr01.jpg'
    },{
        v:2,
        "id": 1,
        "title": "城市轨道交通",
        "content": "内容",
        'name':'公安三所',
        "createTime": "2019-12-05 14:53:05",
        "editTime": null,
        'img':'../../../../assets/img/home-page/cmr01.jpg'
    },{
        v:13,
        "id": 1,
        "title": "城市轨道交通安全防范系统",
        "content": "内容",
        'name':'公安三所',
        "createTime": "2019-12-05 14:53:05",
        "editTime": null,
        'img':'../../../../assets/img/home-page/cmr01.jpg'
    },{
        v:14,
        "id": 1,
        "title": "城市轨道交通公共安全防范系统工程",
        "content": "内容",
        'name':'公安三所',
        "createTime": "2019-12-05 14:53:05",
        "editTime": null,
        'img':'../../../../assets/img/home-page/cmr01.jpg'
    },{
        v:21,
        "id": 1,
        "title": "单位（楼宇）",
        "content": "内容",
        'name':'公安三所',
        "createTime": "2019-12-05 14:53:05",
        "editTime": null,
        'img':'../../../../assets/img/home-page/cmr01.jpg'
    },{
        v:47,
        "id": 1,
        "title": "电力设施",
        "content": "内容",
        'name':'公安三所',
        "createTime": "2019-12-05 14:53:05",
        "editTime": null,
        'img':'../../../../assets/img/home-page/cmr01.jpg'
    },{
        v:23,
        "id": 1,
        "title": "高安全楼寓对讲系统",
        "content": "内容",
        'name':'公安三所',
        "createTime": "2019-12-05 14:53:05",
        "editTime": null,
        'img':'../../../../assets/img/home-page/cmr01.jpg'
    },{
        v:10,
        "id": 1,
        "title": "公共供水系统",
        "content": "内容",
        'name':'公安三所',
        "createTime": "2019-12-05 14:53:05",
        "editTime": null,
        'img':'../../../../assets/img/home-page/cmr01.jpg'
    },{
        v:39,
        "id": 1,
        "title": "光纤振动入侵探测系统",
        "content": "内容",
        'name':'公安三所',
        "createTime": "2019-12-05 14:53:05",
        "editTime": null,
        'img':'../../../../assets/img/home-page/cmr01.jpg'
    },{
        v:5,
        "id": 1,
        "title": "广播电影电视系统重点单位重要部位",
        "content": "内容",
        'name':'公安三所',
        "createTime": "2019-12-05 14:53:05",
        "editTime": null,
        'img':'../../../../assets/img/home-page/cmr01.jpg'
    }];
    tj01 = ['不限', '委托检测', '型式检测', '远程检测'];
    tj02 = ['不限', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'];
    tj03 = ['安全防范工程系统', '入侵报警类', '视频监控类', '道路交通类', '出入口控制类', '反恐防爆安检类', '生物识别类', '侦查防护类', '电磁兼容类', '电气安全类', '实体防护类',
    '警用装备类',
    '可靠性试验类',
    '信息安全类',
    '公安专用类',
    '软件类',
    '智能联网类',
    '信息系统'];

    constructor(
        private message: MessageService,
        private api: ApiService,
        private msg: NzMessageService,
        private router: Router
    ) {
        // this.message.sendMessage('消息已阅读',{st:true});
        // this.getList();
        this.message.setBreadcrumb({
            breadcrumbs: [
                { name: '' }
            ]
        });
    }

    onLoadMore() {

    };
    toDel(item) {
        this.router.navigate(['/member/center/noticeDel'], {
            queryParams: {
                id: item.id
            },
        });
      
    };

    getList() {
        this.api.post('公告列表', this.page).then((res: any) => {
            this.list = res['data']['list'];
            this.page.pageNo = res['data']['pageNo'];
            this.page.pages = res['data']['pages'];
        }).catch((res) => {
            this.msg.error(res.message);
        });
    }
    getClass() {
        this.api.post('热门监控分类列表',{}).then((res: any) => {
        }).catch((res) => {
            this.msg.error(res.message);
        });
    }
}